home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Icon / c / ButtIsHeld < prev    next >
Text File  |  1995-07-08  |  2KB  |  49 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Icon.ButtIsHeld.c
  12.     Author:  Copyright © 1994 Lenny
  13.     Version: 0.01 (23 Nov 1994)
  14.     Purpose: Returns TRUE if a mouse button is held down.
  15.     History: 0.01 (23 Nov 94) : Added 'Icon_ButtonIsHeld()'
  16.  
  17. */
  18.  
  19. /* --- LOAD HEADERS ------------------------------------------------------ */
  20.  
  21. /* --- DeskLib ----------------------------------------------------------- */
  22. #include "DeskLib:WimpSWIs.h"          /* Low-level WIMP commands          */
  23. #include "DeskLib:Icon.h"
  24.  
  25. /* === FUNCTION DEFINITIONS ============================================== */
  26.  
  27. extern BOOL Icon_ButtonIsHeld(void)
  28. /*
  29.  *  Returns TRUE if a mouse button is held down.
  30.  *
  31.  *  Usage : With inc/dec type icons where auto-repeat is required for an
  32.  *          icon using a 3D effect, with a button type 'Click'.
  33.  *          It prevents the annoying repeated indent-outdent effect
  34.  *          produced when using a button type 'Auto-Repeat' with a 3D
  35.  *          icon.
  36.  *  It currently returns TRUE, even if the pointer is no longer over the
  37.  *  icon, provided the button is still held down.
  38.  */
  39. {
  40.   mouse_block       mouse;
  41.  
  42.   Wimp_GetPointerInfo(&mouse);  /*  Get mouse button info  */
  43.  
  44.   return ((mouse.button.value & 0x07) != 0);
  45.  
  46. }
  47.  
  48. /***************************************************************************/
  49.